package java基础;

import java.math.BigDecimal;

public class BD大坑 {
    public static void main(String[] args) {
        {
            BigDecimal a = new BigDecimal(1.00);
            BigDecimal b = new BigDecimal(1.0);
            System.out.println(a.compareTo(b));//不区分精度
            System.out.println(a.equals(b));//区分精度
            System.out.println(a.toPlainString());
        }
        {
            BigDecimal a = new BigDecimal(1.46);
            System.out.println(a.divide(new BigDecimal(1), 1, BigDecimal.ROUND_DOWN));
            System.out.println(a.divide(new BigDecimal(1), 1, BigDecimal.ROUND_HALF_UP));
            System.out.println(a.divide(new BigDecimal(1), 1, BigDecimal.ROUND_UP));


        }
    }
}
